/*
 * Created by SharpDevelop.
 * User: lovepro
 * Date: 2008-7-28
 * Time: 9:41
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
//#define INDLL

using System;
//using n2 = MySpace2;
//using n3 = MySpace2.MySpace3;
using MySpace2;
using MySpace2.MySpace3;
using n = MySpace2.MySpace4;

namespace MySpace1
{
	public class Space1
	{
		static void Main()
		{
			Console.WriteLine("I am now in MySpace1.");
			Console.WriteLine("uing namespace MySpace2:");
			MySpace2.Space2 s2 = new MySpace2.Space2();
			s2.Print();
			
			Console.WriteLine("uing namespace MySpace2.MySpace3:");
			MySpace2.MySpace3.Space3 s3 = new MySpace2.MySpace3.Space3();
			s3.Print();
			
			//Another method
			/*
			n2.Space2 s4 = new n2.Space2();
			s4.Print();
			
			n3.Space3 s5 = new n3.Space3();
			s5.Print();
			*/
			
			//Another method without alis
			
			Space2 s4 = new Space2();
			s4.Print();
			
			Space3 s5 = new Space3();
			s5.Print();

#if INDLL
			Console.WriteLine("Call method from a dll file.");
#else
			Console.WriteLine("Compiled with a another file.");
#endif	

			//Call namespace in another file
			SpaceExt s6 = new SpaceExt();
			s6.Print();
			
			n.SpaceExt s7 = new n.SpaceExt();
			s7.Print();
		}
	}
}

namespace MySpace2
{
	public class Space2
	{
		public void Print()
		{
			Console.WriteLine("I am now in namespace[MySpace2] class[Space2].");
			Console.Write("\n");
		}
	}
	
	namespace MySpace3
	{
		public class Space3
		{
			public void Print()
			{
				Console.WriteLine("I am now in namespace[MySpace2.MySpace3] class[Space3].");
				Console.Write("\n");
			}
		}
	}
}
